{% load staticfiles %}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>中国保健品质量溯源平台</title>

{#    <link href="/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" />#}
{#<link href="~/Content/bootstrap3-editable/css/bootstrap-editable.css" rel="stylesheet" />#}
{#<link href="/Content/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />#}
{##}
{#<script src="/Scripts/jquery-1.9.1.min.js"></script>#}
{#<script src="/Content/bootstrap/js/bootstrap.min.js"></script>#}
{#<script src="~/Content/bootstrap3-editable/js/bootstrap-editable.js"></script>#}
{#<script src="~/Content/bootstrap-table/bootstrap-table.js"></script>#}
{#<script src="/Content/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>#}
{#<script src="~/Content/bootstrap-table/extensions/editable/bootstrap-table-editable.js"></script>#}

    <link rel="stylesheet" type="text/css" href="{% static 'smErp/assets/css/bootstrap.min.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'smErp/assets/css/bootstrap-editable.min.css' %}">

    <link rel="stylesheet" type="text/css" href="{% static "smErp/css/base.css" %}"/>
    <link rel="stylesheet" type="text/css" href="{% static "smErp/css/tab.css" %}"/>
    <link rel="stylesheet" type="text/css" href="{% static "smErp/css/list.css" %}"/>
    <link rel="stylesheet" type="text/css" href="{% static "smErp/css/lib.css" %}"/>
    <link rel="stylesheet" type="text/css" href="{% static "smErp/css/pop_tips.css" %}"/>
    <link rel="stylesheet" type="text/css" href="{% static "smErp/css/popover.css" %}"/>
    <link rel="stylesheet" type="text/css" href="{% static 'smErp/css/index.css' %}">
    <!-- datatables -->
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.16/b-1.4.2/b-html5-1.4.2/datatables.min.css"/>

    <script type="text/javascript" src="{% static "smErp/assets/js/jquery-2.1.4.min.js" %}"></script>
    <!-- bootstrap -->
    <script type="text/javascript" src="{% static 'smErp/assets/js/bootstrap.min.js' %}"></script>
    <script type="text/javascript" src="{% static 'smErp/assets/js/bootstrap-editable.min.js' %}"></script>

    <!-- datatables -->
    <script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.16/b-1.4.2/b-html5-1.4.2/datatables.min.js"></script>

    <!--Required libraries-->
    <link rel="stylesheet" type="text/css" href="{% static 'smErp/assets/layui/css/layui.css' %}">

{#    <script src="{% static 'smErp/assets/flicker/jquery-v1.js' %}" type="text/javascript"></script>#}
    <script src="{% static 'smErp/assets/flicker/modernizr-custom-v2.js' %}" type="text/javascript"></script>
    <script src="{% static 'smErp/assets/flicker/jquery-finger-v0.js' %}" type="text/javascript"></script>
    <script src="{% static 'smErp/assets/layer/layer.js' %}" type="text/javascript"></script>
    <script src="{% static 'smErp/assets/layui/layui.js' %}" type="text/javascript"></script>
    <!--Include flickerplate-->
    <link href="{% static 'smErp/assets/flicker/flickerplate.css' %}" type="text/css" rel="stylesheet">
    <script src="{% static 'smErp/assets/flicker/flickerplate.js' %}" type="text/javascript"></script>
    <script src="{% static 'smErp/js/common.js' %}" type="text/javascript"></script>
    <!-- vue -->
{#    <script src="https://cdn.jsdelivr.net/npm/vue" type="text/javascript"></script>#}
    {% block css_style %}
    {% endblock %}

</head>

<body class="page_manage  zh_CN">

{% include "smErp/base_header.html" %}

{% block content %} {% endblock %}

<!-- 底部 -->
{% include "smErp/base_footer.html" %}

{#<script src="{% static 'smErp/js/main.js' %}" type="text/javascript"></script>#}
<script type="text/javascript" charset="utf-8">

    window.nav = {
        selected: function (id) {
            jQuery(".jsNavItem[data-id='" + id + "']").addClass('selected').siblings().removeClass('selected');
        }
    };

    if (!window.location.origin) {
        window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
    }

        console.log(window.location.origin);
        // 设置主菜单
        //window.nav.selected("index");

{#        function initNavTabUl() {#}
{#            $("#menu_nav").children().click(function () {#}
{#                alert("hello");#}
{#                var apptype = $(this).data("id");#}
{#                var url = $(this).children().data("url");#}
{#                console.log(url);#}
{#                console.log(apptype);#}
{#                selectMenuNav(apptype);#}
{#                open_sub_menu(url);#}
{#            });#}
{#        }#}
{##}
{#        function selectMenuNav(apptype) {#}
{#            var nav = $(".jsNavItem[data-id='" + apptype + "']");#}
{#            nav.addClass('selected').siblings().removeClass('selected');#}
{#            loadMenuNavContent(apptype);#}
{##}
{##}
{#        }#}
{#        function loadMenuNavContent(apptype) {#}
{#            var content_box = $("#content_box");#}
{#            content_box.html("加载中" + apptype + "...");#}
{#        }#}
{##}
{#        function open_sub_menu(url) {#}
{#            function callback(data, status, xhr) {#}
{#                if (status == "success") {#}
{#                    $('#context_box').empty();#}
{#                    $('#context_box').html(data);#}
{#                } else {#}
{#                    $("#content_box").html("错误信息: <br/>" + xhr.status + " " + xhr.statusText)#}
{#                }#}
{#            }#}
{##}
{#            // 请求编辑框的页面数据库#}
{#            $.get(url, "", callback);#}
{#        }#}
{##}
{#        initNavTabUl();#}
{#        selectAppTab("product");#}
{#        initAppTabUl();#}

{#        function initAppTabUl() {#}
{#            $("#appTabUl").children().click(function () {#}
{#                var apptype = $(this).attr("apptype");#}
{#                console.log(apptype);#}
{#                selectAppTab(apptype);#}
{#            });#}
{#        }#}



{#        function selectAppTab(apptype) {#}
{#            var tab = $(".tab_nav[apptype='" + apptype + "']");#}
{#            tab.addClass('selected').siblings().removeClass('selected');#}
{#            loadAppTabContent(apptype);#}
{#        }#}

{#        function loadAppTabContent(apptype) {#}
{#            var data_box = $("#data_box");#}
{#            data_box.html("加载中" + apptype + "...");#}
{#        }#}

</script>

{% block footscript %}

{% endblock %}
<script type="text/javascript" charset="utf-8">
        // 设置主菜单
        function smErp_login(){
            $("#error_msg").hide();
{#                alert("登录");#}
            function callback(data, status, xhr){
                if(status == "success"){
                    if(data.result == 0){
                        window.location.href = "{% url "smErp:index" %}" ;
                    }else if(data.result == 5) {
                        window.location.href = "{% url "smErp:register" %}" ;
                    }else if(data.result == 6) {
                        window.location.href = "{% url "smErp:complete_company" %}" ;
                    }
                    else{
                        $("#error_msg").html(data.reason);
                        $("#error_msg").show();
                    };
                }else{
                    alert(status);
                }
            }

            var email = $("#login-email").val();
            var passwd = $("#login-passwd").val();
            if(!email || !passwd){
                $("#error_msg").html("请输入用户名和密码");
                $("#error_msg").show();
            }else{
                $.post("{% url "smErp:login" %}", {"email": email, "passwd": passwd}, callback, 'json');
            }

        }


        $(document).ready(function(){
	        $('.flicker-example').flicker();



            $("body").on('click',".account-login", function(){
{#                alert("hello world");#}
                // 弹出登录窗
                var login_html = '<div class="login_input_contain"><span class="login_input_box first login_input_row">' +
                '<label class="login_label">邮箱</label><input placeholder="请填写登录邮箱" class="frm_input" id="login-email" name="email" type="text"></span>' +
                '<span class="login_input_box last login_input_row"><label class="login_label">密码</label><input placeholder="请填写密码" class="frm_input" id="login-passwd" name="passwd" type="password"></span></div>'+
                '<div class="login_function_contain"><label><input title="re" checked="" type="checkbox"><span class="lbl_content">记住帐号</span></label> ' +
                '<a href="{% url "smErp:forget_password" %}" id="wxLogin_1502174259128_forget" class="jsUrlLink" data-url="regist/forget">忘记密码</a></div>'+
                '<div id="error_msg" class="hider err_msg"></div><div class="login_tool_area"><a href="javascript:void(0);" class="btn btn_primary btn_login" id="smErp_login" onclick="smErp_login()">登录</a>' +
                '<a href="/smErp/register" class="btn btn_default btn_regist" id="wxLogin_1502174259128_regist">注册</a></div>';

                layer.open({
                      type: 1 //Page层类型
                      ,area: ['500px', '320px']
                      ,title: '登录'
                      ,shade: 0.6 //遮罩透明度
                      ,anim: 2 //0-6的动画形式，-1不开启
                      ,content: login_html
                });
            });

        });


    </script>
</body>


</html>

